package com.example.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shop.bean.UserBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper extends BaseMapper<UserBean> {
    // 方法抽象
    // 访问控制符默认抽象

    @Select("select * from tbl_user where username=#{username} and password=#{password} and status=#{status}") //注意这里的取值操作
    UserBean getUser(UserBean bean); // 这里有可能偷摸改名，所以要加上注解

    @Select("select * from tbl_user where username=#{username}")
    UserBean haveUser(@Param("username")String username);
}
